package com.framework.bdf4j.sysadm.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.github.liaochong.myexcel.core.annotation.ExcelColumn;
import com.github.liaochong.myexcel.core.annotation.ExcelModel;
import com.github.liaochong.myexcel.core.annotation.IgnoreColumn;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * <p>
 * 用户表
 * </p>
 *
 */
@Data
@ApiModel(value = "用户")
@ExcelModel(sheetName = "用户信息", includeAllField = false)
public class SysUser implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(value = "user_id", type = IdType.AUTO)
    @ApiModelProperty(value = "主键id")
    @IgnoreColumn
    private Integer userId;
    /**
     * 登录名
     */
    @ApiModelProperty(value = "登录名")
    @ExcelColumn(order = 0, title = "登录名")
    private String loginname;
    /**
     * 用户名
     */
    @ApiModelProperty(value = "用户名")
    @ExcelColumn(order = 1, title = "用户名")
    private String username;
    /**
     * 密码
     */
    @ApiModelProperty(value = "密码")
    @ExcelColumn(title = "密码")
    @IgnoreColumn
    private String password;
    /**
     * 随机盐
     */
    @JsonIgnore
    @ApiModelProperty(value = "随机盐")
    private String salt;
    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @ExcelColumn(order = 5, title = "创建时间")
    private Date createTime;
    /**
     * 修改时间
     */
    @ApiModelProperty(value = "修改时间")
    private Date updateTime;
    /**
     * 0-正常，1-删除
     */
    @TableLogic
    @ApiModelProperty(value = "删除标记,1:已删除,0:正常")
    private String delFlag;
    /**
     * 锁定标记
     */
    @ApiModelProperty(value = "锁定标记,0:正常,9:已锁定")
    private String lockFlag;
    /**
     * 手机号
     */
    @ApiModelProperty(value = "手机号")
    @ExcelColumn(order = 2, title = "手机号")
    private String phone;
    /**
     * 邮箱
     */
    @ApiModelProperty(value = "邮箱")
    @ExcelColumn(order = 3, title = "邮箱")
    private String email;
    /**
     * 头像
     */
    @ApiModelProperty(value = "头像地址")
    private String avatar;
    /**
     * 部门ID
     */
    @ApiModelProperty(value = "用户所属部门id")
    private Integer deptId;
    /**
     * 说明
     */
    @ApiModelProperty(value = "说明")
    private String remark;
    /**
     * 租户ID
     */
    @ApiModelProperty(value = "用户所属租户id")
    private Integer tenantId;
    /**
     * 微信openid
     */
    @ApiModelProperty(value = "微信openid")
    private String wxOpenid;
    /**
     * 微信小程序openId
     */
    @ApiModelProperty(value = "微信小程序openid")
    private String miniOpenid;
    /**
     * QQ openid
     */
    @ApiModelProperty(value = "QQ openid")
    private String qqOpenid;
    /**
     * 码云唯一标识
     */
    @ApiModelProperty(value = "码云唯一标识")
    private String giteeLogin;
    /**
     * 开源中国唯一标识
     */
    @ApiModelProperty(value = "开源中国唯一标识")
    private String oscId;
    /**
     * 部门名称
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "所属部门名称")
    @ExcelColumn(order = 4, title = "所属部门名称")
    private String deptName;
    /**
     * 角色列表
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "拥有的角色列表")
    private List<SysRole> roleList;

    /**
     * 选中的角色ID
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "角色id集合")
    private List<Integer> roleIds;
}
